/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interfaz;

import java.util.ArrayList;
import javax.swing.JButton;

/**
 *
 * @author pedro
 */
public class PNiveles extends javax.swing.JPanel {

    public JButton getBtAtras() {
        return btAtras;
    }

    /**
     * Creates new form PNiveles
     */
    private ArrayList<JButton> botones;
    public PNiveles() {
        initComponents();
        botones= new ArrayList<JButton>();
        botones.add(jButton1);
        botones.add(jButton2);
        botones.add(jButton3);
        botones.add(jButton4);
        botones.add(jButton5);
        botones.add(jButton6);
        botones.add(jButton7);
        botones.add(jButton8);
        botones.add(jButton9);
        botones.add(jButton10);
    }

    public JButton getjButton1() {
        return jButton1;
    }

    public JButton getjButton2() {
        return jButton2;
    }

    public JButton getjButton3() {
        return jButton3;
    }

    public JButton getjButton4() {
        return jButton4;
    }

    public JButton getjButton5() {
        return jButton5;
    }

    public JButton getjButton10() {
        return jButton10;
    }

    public JButton getjButton6() {
        return jButton6;
    }

    public JButton getjButton7() {
        return jButton7;
    }

    public JButton getjButton8() {
        return jButton8;
    }

    public JButton getjButton9() {
        return jButton9;
    }
    
    public void InitButtons(int max){
        for(int i=0;i<botones.size();i++){
            if(i<max){
                ((JButton)botones.get(i)).setVisible(true);
            }else{
                ((JButton)botones.get(i)).setVisible(false);
            }
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        btAtras = new javax.swing.JButton();

        setLayout(null);

        jButton1.setText("nivel1");
        add(jButton1);
        jButton1.setBounds(75, 79, 82, 29);

        jButton2.setText("nivel2");
        add(jButton2);
        jButton2.setBounds(193, 79, 82, 29);

        jButton3.setText("nivel3");
        add(jButton3);
        jButton3.setBounds(75, 126, 82, 29);

        jButton4.setText("nivel4");
        add(jButton4);
        jButton4.setBounds(193, 126, 82, 29);

        jButton5.setText("nivel5");
        add(jButton5);
        jButton5.setBounds(75, 173, 82, 29);

        jButton6.setText("nivel6");
        add(jButton6);
        jButton6.setBounds(193, 173, 82, 29);

        jButton7.setText("nivel7");
        add(jButton7);
        jButton7.setBounds(75, 220, 82, 29);

        jButton8.setText("nivel8");
        add(jButton8);
        jButton8.setBounds(193, 220, 82, 29);

        jButton9.setText("nivel9");
        add(jButton9);
        jButton9.setBounds(75, 267, 82, 29);

        jButton10.setText("nivel10");
        add(jButton10);
        jButton10.setBounds(193, 267, 90, 29);

        btAtras.setText("Atras");
        add(btAtras);
        btAtras.setBounds(20, 360, 77, 29);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btAtras;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    // End of variables declaration//GEN-END:variables
}
